package com.example.attempt.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.time.LocalDateTime;

@Data
public class Submit {
    @TableId(value = "submitId",type = IdType.AUTO)
    private int submitId;
    private int hid;
    private String sid;
    // 表示返回时间类型
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")      // 表示接收时间类型
    private LocalDateTime submit_time;
    private String submit_content;
    private String submit_link;
    private double similarity;

    public Submit(int submit_id,int hid,String sid,LocalDateTime submit_time,String submit_content,String submit_link,double similarity){
        this.submitId=submit_id;
        this.hid=hid;
        this.sid=sid;
        this.submit_time=submit_time;
        this.submit_content=submit_content;
        this.submit_link=submit_link;
        this.similarity=similarity;
    }
    public Submit(SubmitWithFile submitWithFile,String submit_link,double similarity){
        this.submitId=0;
        this.sid=submitWithFile.getSid();
        this.hid=submitWithFile.getHid();
        this.submit_time=submitWithFile.getSubmit_time();
        this.submit_content=submitWithFile.getSubmit_content();
        this.submit_link=submit_link;
        this.similarity=similarity;
    }

}
